<!DOCTYPE html>
<html lang="zh-CN"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.css">
  <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.js"></script>
  <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.js"></script>
  <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.js"></script>

  <title>Title</title>
</head>
<body>
<h1>首页</h1>

<div id="custom">
  <p th:text="${msg}">welcome</p>

  <p shiro:notAuthenticated="">
    Please <a th:href="@{/login}">login</a>
  </p>

  <p shiro:authenticated="">
    Hello, <span shiro:principal=""></span>, how are you today? |
    <a th:href="@{/logout}">logout</a>
  </p>

  <a th:href="@{/info}">INFO</a> |
  <a th:href="@{/user/add}" shiro:hasPermission="user:add">add</a> |
  <a th:href="@{/user/del}" shiro:hasPermission="user:del">del</a> |
  <a th:href="@{/user/get}" shiro:hasPermission="user:get">get</a> |
</div>

<hr>

<div id="shiro-test">
  <p shiro:guest="">Please <a th:href="@{/login}">login</a></p>
  <p shiro:user="">
    Welcome back John! Not John? Click <a href="login.html">here</a> to login.
  </p>
  <p shiro:authenticated="">
    Hello, <span shiro:principal=""></span>, how are you today?
  </p>
  <p shiro:notAuthenticated="">
    Please <a href="login.html">login</a> in order to update your credit card information.
  </p>

  <p>Hello, <shiro:principal/>, how are you today?</p>

  <a shiro:hasRole="administrator" href="admin.html">Administer the system</a>
  <p shiro:lacksRole="administrator">
    Sorry, you are not allowed to administer the system.
  </p>
  <p shiro:hasAllRoles="developer, project manager">
    You are a developer and a project manager.
  </p>
  <p shiro:hasAnyRoles="developer, project manager, administrator">
    You are a developer, project manager, or administrator.
  </p>

  <a shiro:hasPermission="user:create" href="createUser.html">Create a new User</a>
  <p shiro:lacksPermission="user:delete">
    Sorry, you are not allowed to delete user accounts.
  </p>
  <p shiro:hasAllPermissions="user:create, user:delete">
    You can create and delete users.
  </p>
  <p shiro:hasAnyPermissions="user:create, user:delete">
    You can create or delete users.
  </p>
</div>

</body>
</html>
